package com.fuerda.izb.utils

import android.content.Context
import android.view.View

fun dp2px(context: Context, dp: Int): Int {
    val displayMetrics = context.resources.displayMetrics
    return (dp * displayMetrics.density + 0.5).toInt()
}

fun dp2px(context: Context, dp: Double): Int {
    val displayMetrics = context.resources.displayMetrics
    return (dp * displayMetrics.density + 0.5).toInt()
}

fun View.showVisible() {
    this.visibility = View.VISIBLE
}

fun View.goneVisible() {
    this.visibility = View.GONE
}

fun View.hideVisible() {
    this.visibility = View.INVISIBLE
}

fun View.isVisible() = this.visibility == View.INVISIBLE

